package com.yitianyigexiangfa.designpattern.facade.hometheater.subsystem;

/**
 * 扩音器
 *
 * @author Bill Lau
 * @date 2018-01-18
 */
public class Amplifier {

    private Tuner tuner = new Tuner();

    private DvdPlayer dvdPlayer = new DvdPlayer();

    private CdPlayer cdPlayer = new CdPlayer();


    public void on() {
        System.out.println("Amplifier on");
    }

    public void off() {
        System.out.println("Amplifier off");
    }

    public void setCd(CdPlayer cdPlayer) {
        System.out.println("Amplifier connect to cd player");
    }

    public void setDvd(DvdPlayer dvdPlayer) {
        System.out.println("Amplifier connect to dvd player");
    }

    /**
     * 设置立体声
     */
    public void setStereoSound() {
        System.out.println("Start stereo sound");
    }

    public void setTuner(Tuner tuner) {
        System.out.println("set tuner:" + tuner);
    }

    public void setVolume(int volume) {
        System.out.println("set volume:" + volume);
    }

    @Override
    public String toString() {
        return "Amplifier{" +
               "tuner=" + tuner +
               ", dvdPlayer=" + dvdPlayer +
               ", cdPlayer=" + cdPlayer +
               '}';
    }

}
